package engine.graphics.away3d
{
	import away3d.animators.data.*;
	import away3d.animators.skeleton.*;
	import away3d.core.base.*;
	
	import engine.math.*;
	
	public class RxSkeletonAnimationState extends AnimationStateBase
	{
		private var m_rotTransArray:Vector.<RxRotTrans>;
		private var _numJoints:uint;
		private var _skinnedAnimation:RxSkeletonAnimation;
		private var _jointsPerVertex:uint;
		private var _skeleton:Skeleton;
		private var _blendTree:SkeletonNaryLERPNode;
		private var _globalPose:SkeletonPose;
		private var _globalInput:Boolean;
		private var _rotTransInvalid:Boolean;
		
		public function RxSkeletonAnimationState(animation:RxSkeletonAnimation)
		{
			super(animation);
			this._skinnedAnimation = animation;
			if (animation.numJoints > 0)
			{
				this.init();
			}
		}
		
		private function init() : void
		{
			this._jointsPerVertex = this._skinnedAnimation.jointsPerVertex;
			this._skeleton = this._skinnedAnimation.skeleton;
			this._numJoints = this._skinnedAnimation.numJoints;
			// change for yzb
			//this._globalPose = new SkeletonPose(_numJoints);
			this._globalPose = new SkeletonPose();
			this.m_rotTransArray = new Vector.<RxRotTrans>(this._numJoints, true);
			var i:int = 0;
			while (i < this._numJoints)
			{
				
				this.m_rotTransArray[i] = new RxRotTrans();
				i++;
			}
		}
	}
}